package o;

import android.graphics.drawable.Drawable;
import android.view.View;
import com.huawei.appgallery.foundation.ui.framework.widget.button.DownloadButton;
import huawei.widget.HwDownLoadWidget;
import java.lang.reflect.Field;

public class ehh extends SkinAttr {

    static class b extends fkz<SkinAttr, Drawable> {
        DownloadButton ˎ;

        public /* synthetic */ void ॱ(Object obj) {
            ˊ((Drawable) obj);
        }

        public b(DownloadButton downloadButton) {
            this.ˎ = downloadButton;
        }

        public void ˊ(Drawable drawable) {
            if (this.ˎ != null) {
                Logger.ˏ("DownLoadWidgetBgAttr", "setDownLoadWidgetBg");
                try {
                    Field declaredField = HwDownLoadWidget.class.getDeclaredField("ʽ");
                    declaredField.setAccessible(true);
                    declaredField.set(this.ˎ, drawable);
                } catch (Exception e) {
                    Logger.ˋ("DownLoadWidgetBgAttr", "field error : " + e.toString());
                }
                if (this.ˎ.ॱˊ() != 1) {
                    this.ˎ.ˏॱ().setProgressDrawable(drawable);
                }
            }
        }
    }

    public void ˎ(View view, boolean z) {
        if (view instanceof DownloadButton) {
            DownloadButton downloadButton = (DownloadButton) view;
            if ("drawable".equals(this.attrValueTypeName) || "color".equals(this.attrValueTypeName)) {
                this.ʽ = "drawable";
                fks.ˎ(view.getContext(), this, new b(downloadButton)).ॱ(z);
            }
        }
    }
}
